<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<script src="PLATFORM_JS/app.v2.js"></script>
<script src="__STATIC__/js/common.js"></script>

<link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<script src="ADMIN_JS/art_dialog.source.js"></script>
<script src="ADMIN_JS/iframe_tools.source.js"></script>
<script src="__STATIC__/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="PLATFORM_CSS/app.v1.css" type="text/css" />
{include file="platform/controlCommonVariable" }
<style>
.dialog-box{
	width:95%;
	margin:20px  auto;
}
</style>
</head>
<body>
<div class="dialog-box">
	<div class="row padder-v">
		<div class="col-sm-5">
			<!-- <a href="{:__URL('PLATFORM_MAIN/Shop/addShopGroup')}"
				class="btn btn-sm btn-primary"><i class="fa fa-plus"></i> 添加分组 </a> -->
		</div>
		<div class="col-sm-2">
			<input type="text" id='startDate' placeholder="请选择开始日期" class="input-sm form-control" onclick="WdatePicker()"/>
		</div>
		<div class="col-sm-2">
			<input type="text" id='endDate' placeholder="请选择结束日期" class="input-sm form-control"  onclick="WdatePicker()" />
		</div>
		<div class="col-sm-2">
			<select id="shop_id" class="input-sm form-control" >
				<option value="">请选择店铺名称</option>
				{foreach name="shoplist" item ="vo"}
				<option value="{$vo.shop_id}">{$vo.shop_name}</option>
				{/foreach}
			</select>
		</div>
		<div class="col-sm-2 hide"  >
			<select id="shop_id" class="input-sm form-control" >
				<option value="">请选择类型</option>
				<option value="">类型1</option>
				<option value="">类型1</option>
				<option value="">类型1</option>
			</select>
		</div>
		<div class="col-sm-1">
			<button class="btn btn-sm btn-default" type="button" onclick="LoadingInfo(1)">搜索</button>
		</div>
	</div>
	<section class="panel panel-default">
		<table class="table table-striped b-light text-sm">
			<colgroup>
					<col width="3%">
					<col width="17%">
					<col width="15%">
					<col width="15%">
					<col width="15%">
					<col width="20%">
			</colgroup>
			<thead>
				<tr>
					<th><input type="checkbox"></th>
					<th >流水号</th>
					<th class="left">店铺名称</th>
					<th class="left">类型</th>
					<th class="right">金额</th>
					<th class="center">时间</th>
					<th class="left">备注</th>
				</tr>
			</thead>
			<tbody id="list">
				<tr></tr>
			</tbody>
		</table>
		<!-- <div class="padder-v b-t border-gray" style="padding-bottom: 30px;">
				<div class="col-sm-10"> </div>
				<div class="col-sm-2"><span class="gray" id="reg_person"></span></div>
			</div> -->
		{include file="platform/page" /}
	</section>
</div>

<script type="text/javascript">
$(function(){
	LoadingInfo(1);
});

//查询用户列表
	function LoadingInfo(pageIndex) {
		var start_date = $("#startDate").val();
		var end_date = $("#endDate").val();
		var shop_id = $("#shop_id").val();
		$.ajax({
			type : "post",
			url : "{:__URL('PLATFORM_MAIN/statistics/platformAccountOrderRecordList')}",
			async : true,
			data : {
				"pageIndex" : pageIndex,"start_date":start_date,"end_date":end_date,"shop_id":shop_id},
			success : function(data) {
				
				var html = '';
				$("#total_count_num").text(data['list']["total_count"]);
				$("#page_count_num").text(data['list']["page_count"]);
				$("#page_count").val(data['list']["page_count"]);
				$("#pageNumber a").remove();
				if (data['list']["data"].length > 0) {
					for (var i = 0; i < data['list']["data"].length; i++) {
						html += '<tr>';
						html += '<td><input type="checkbox" name="sub" value="'+ data['list']['data'][i]['id']+'"></td>';
						html += '<td>' + data['list']["data"][i]["order_no"] + '</td>';
						html += '<td>' + data['list']["data"][i]["shop_name"] + '</td>';
						html += '<td>订单</td>';					
						html += '<td class="right">' + (data['list']["data"][i]["order_pay_money"] - data['list']["data"][i]["platform_money"]).toFixed(2) + '</td>';
						html += '<td class="center">' + timeStampTurnTime(data['list']["data"][i]["create_time"]) + '</td>';
						html += '<td>' + data['list']["data"][i]["remark"] + '</td>';
						html += '</tr>';
					}
				}  else {
					html += '<tr class="center"><td colspan="7">暂无订单记录</td></tr>';
				}
				$("#list").html(html);
					var totalpage = $("#page_count").val();
			if (totalpage == 1) {
				changeClass("all");
			}
			var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
			$("#pageNumber").append($html);
			}
		});
	}
	$("#search_text").keypress(function(e){
		if(e.keyCode == 13){
			LoadingInfo(1);
		}
	});
	
</script>
</body>
</html>